'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, NOW } = Sequelize;
    await queryInterface.createTable('thumbs_up', {
      id: { type: INTEGER(10), primaryKey: true, autoIncrement: true },
      topicId: { type: INTEGER(10), allowNull: false }, // 帖子id
      userId: { type: STRING(255), allowNull: false }, // 用户id
      status: { type: INTEGER(1), allowNull: false }, // 帖子状态1: 点赞 0: 取消点赞
      created_at: { type: DATE, defaultValue: NOW }, // 回复创建时间
      updated_at: { type: DATE, defaultValue: NOW }, // 回复创建时间
    });
  },

  down: async queryInterface => {
    return queryInterface.dropTable('thumbs_up');
  },
};
